from tkinter import *
from config import *
from mytools import *
from myexcel import *
from homegnclass import HomeFrame
from noyzm import NYZFrame



class GnnFrame(Frame):
    def __init__(self,master=None):
        Frame.__init__(self,master)
        self.rowCount=IntVar()
        self.createWidgets()

    def createWidgets(self):

                
        self.rbtnFra=Frame(self,width=800)
        self.rbtnFra.pack(pady=5)
        self.v = IntVar()
        self.v.set(1)
        self.lfras=[HomeFrame(self),NYZFrame(self)]
        self.cgpb()

    def changesr(self):

        j=1
        for fra in self.lfras:
            if j==self.v.get():
                fra.pack(fill=X)
            else:
                fra.pack_forget()
            j+=1

    
    def cgpb(self):
        rbtnFra=self.rbtnFra
        Radiobutton(rbtnFra, text="主页", variable=self.v, value=1,command=self.changesr).grid(row=0,column=0,padx=3)
        Radiobutton(rbtnFra, text="采集公司名字(老版)", variable=self.v, value=2,command=self.changesr).grid(row=0,column=1,padx=3)
        self.changesr()

         
# import tkinter
# list_win=tkinter.Tk()
# list_win.wm_geometry("800x650")
# list_win.title('allgero')
# DataFra9(list_win).pack(fill=X,padx=3,pady=3)
# list_win.mainloop()